import pytest

from api.ihrm_login_api import Ihrm_login
from common.read_login_json import read_json
from config import BASE_PATH
from common.assert_tools import assert_tools
filename=BASE_PATH+"/data/ihrm_login_data.json"
data=read_json(filename)


class TestIhrmLogin(object):
    @pytest.mark.parametrize("dectsc,req_body,sratus_code,success,code,message",data)
    def test_login(self,dectsc,req_body,sratus_code,success,code,message):
        login = Ihrm_login()
        resp=login.ihrm_login(req_body)
        print(dectsc,":",resp.json())
        assert_tools(resp,sratus_code,success,code,message)


